home *** CD-ROM | disk | FTP | other *** search
/ Scene 96 / Scene 96 International Edition (Zyklop Software) (Disc 2) (1997).iso / misc / coding / xmasspak / tales / shift_c.inc < prev    next >
Encoding:
Text File  |  1995-12-30  |  991 b   |  48 lines

  1. ;
  2. ; SHIFT_CHARS = Moves the chars in the char_buffer pixel by pixel in x-direc.
  3. ;
  4. ; Variable needed .. DS:CFLAG (byte) .. for shifting-routine
  5.  
  6. shift_chars:  mov cx,16
  7.               add si,80*16
  8.               
  9. sch6:         push cx
  10.               push si
  11.  
  12.               mov cx,81
  13.               
  14. sch5:         cmp [byte ds:cflag],1
  15.               je sch1
  16.  
  17.               mov al,[ds:si]
  18.               shl al,1
  19.               jnc sch4
  20.               mov [byte ds:cflag],1
  21.  
  22. sch4:         mov [ds:si],al
  23.  
  24.               jmp sch2
  25.  
  26. sch1:         mov [byte ds:cflag],0
  27.               mov al,[ds:si]
  28.               shl al,1
  29.               jnc sch3
  30.               mov [byte ds:cflag],1
  31.               
  32. sch3:         or al,1
  33.               mov [ds:si],al
  34.  
  35. sch2:         sub si,16
  36.               dec cx
  37.               jnz sch5
  38.  
  39.               pop si
  40.               pop cx
  41.  
  42.               inc si
  43.               dec cx
  44.               jnz sch6
  45.               
  46.               ret
  47.  
  48.